package com.example.demo.controller;

import com.example.demo.entity.school.AllData;
import com.example.demo.entity.school.SchoolProvince;
import com.example.demo.service.SchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class SchoolController {
    @Autowired
    private SchoolService schoolService;

    @GetMapping("/getSum")
    private List<SchoolProvince> getSum() {
        return schoolService.getSum();
    }

    @GetMapping("/getDegree")
    private int getDegree() {
        return schoolService.degreeSum();
    }

    @GetMapping("/getSpecialist")
    private int getSpecialist() {
        return schoolService.specialistSum();
    }

    @GetMapping("/getEightDegreeSum")
    public List<SchoolProvince> getEightDegreeSum(){
        return schoolService.getEightDegreeSum();
    }

    @GetMapping("/getEightSpecialistSum")
    public List<SchoolProvince> getEightSpecialistSum(){
        return schoolService.getEightSpecialistSum();
    }

    @GetMapping("/lookAll")
    public List<AllData> lookAll(){
        return schoolService.lookAll();
    }

}
